package Arr;

public class qi {
  public static void reor(int[]nums){
      if(nums==null||nums.length<=1){
          return;
      }
      int left=0, right=nums.length-1;
      while (left<right){
          while (left < right && nums[left]%2==0){
              left++;
          }
          while (left<right&&nums[right]%2!=0){
              right--;
          }
          if (left<right){
              swap(nums, left, right);
              left++;
              right--;

          }
      }
  }
    private static void swap(int[] nums, int i, int j) {
        int temp = nums[i];
        nums[i] = nums[j];
        nums[j] = temp;
    }

}
